package com.twu.biblioteca;

/**
 * Created by jjwang on 4/21/14.
 */
public class Movie {

    User loaner;
    String name;
    int year;
    String director;
    int rate;
    boolean available;

    public Movie(String director, String name) {
        this.director = director;
        this.name = name;
        this.year = (int)(Math.random() * 42) + 1970;
        this.rate = (int)(Math.random() * 10);
        this.available = true;
    }

    public User getLoaner() {
        return loaner;
    }

    public void setLoaner(User loaner) {
        this.loaner = loaner;
    }

    public String getMovieInfo(){
        String info;
        info = "\""+this.name + "\""+ ": \n";
        info += "Year: " + this.year + "\n";
        info += "Director: " + this.director + "\n";
        info += "Rate: " + this.rate + "\n";
        return info;
    }

    public boolean isAvailable() {
        return available;
    }

    public String getName() {
        return name;
    }

    public void setAvailable(boolean available) {
        this.available = available;
    }
}
